import request from "@/utils/request";
import type {getSessionIdPramsType, wechatLoginPramsType} from "@/types/third";
// 第三方登录接口

export default {
    // 获取小程序sessionKey（后端不会给前端返回真实的sessionKey）
    getSessionIdApi: (data:getSessionIdPramsType) => request({
        url: '/api/sum.third.wechat/getSessionId',
        method: 'POST',
        data,
        custom: {
            showLoading: false,
        }
    }),
    // 微信登录
    wechatLoginApi: (data:wechatLoginPramsType) => request({
        url: '/api/sum.third.wechat/login',
        method: 'POST',
        data,
        custom: {
            showSuccess: true,
            loadingMsg: '登陆中',
        }
    }),
    // 微信小程序 绑定一键获取的手机号
    bindUserPhoneNumberApi:(data:any)=>request({
        url: '/api/sum.third.wechat/bindUserPhoneNumber',
        method: 'POST',
        data,
        custom: {
            showSuccess: true,
            loadingMsg: '获取中',
        },
    })
}
